package cn.kgc.controller;

import cn.kgc.vo.Condition;
import cn.kgc.dtos.Dto;
import cn.kgc.service.ItripHotelOrderService;
import io.swagger.annotations.ApiParam;
import org.springframework.data.querydsl.binding.QuerydslPredicate;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/api")
public class ItripHotelOrderController {

    @Resource
    private ItripHotelOrderService itripHotelOrderService;


    //订单列表查询
    @RequestMapping(value = "/hotelorder/getpersonalorderlist",method = RequestMethod.POST)
    public Dto getpersonalorderlisti(@RequestBody Condition condition, HttpServletRequest request){
        return itripHotelOrderService.selectOrderAll(condition,request.getHeader("token"));
    }
    //订单详情信息
    @RequestMapping("/hotelorder/getpersonalorderinfo/{orderId}")
    public  Dto getpersonalorderinfo(@PathVariable(value = "orderId")int orderId){
        return  itripHotelOrderService.selectOrderByid(orderId);
    }

    //订单查询
    @RequestMapping("/hotelorder/getpersonalorderroominfo/{orderId}")
    public  Dto getpersonalorderroominfo(@PathVariable(value = "orderId")int orderId){
        return itripHotelOrderService.selectOrderByid(orderId);
    }
     //订单详情信息
    @RequestMapping("/hotelorder/queryOrderById/{orderId}")
    public  Dto queryOrderById(@PathVariable(value = "orderId")int orderId){
        return itripHotelOrderService.selectOrderByid(orderId) ;
    }
}
